﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="WinnerCMS.WebUI.Admin.Model.Manage" %>

<!doctype html>
<html>
<head runat="server">
    <title>模型数据库表</title>
    <meta charset="utf-8">
    <meta content="no-cache" http-equiv="Pragma" />
    <%: Scripts.Render("~/Scripts/AdminBase") %>
    <%: Styles.Render("~/Content/Bootstrap/css") %>

    <script type="text/javascript">
        $(function () {
            $("[datafld^='WinnerCMS_']").each(function () {
                var span = this;
                $.ajax({
                    type: "post",
                    dataType: "html",
                    url: "DataHandler.ashx?Action=DBTableCount&TableName=" + $(this).attr("datafld"),
                     
                    success: function (data) {
                        $(span).html(data);
                    }
                });
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <BootStrap:Breadcrumb runat="server" ID="BRPath">
                    <asp:ListItem Text="模型管理"></asp:ListItem>
                <asp:ListItem Text="模型数据库表"></asp:ListItem>
                </BootStrap:Breadcrumb>
                <asp:GridView ID="GV_List" CssClass="table table-bordered table-striped table-borde table-hover" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="ID" OnRowDataBound="GV_List_RowDataBound"
                    OnRowDeleting="GV_List_RowDeleting" GridLines="None">
                    <Columns>
                        <asp:TemplateField HeaderText="选择" Visible="false">
                            <ItemStyle Width="30px" HorizontalAlign="Center" />
                            <ItemTemplate>
                                <asp:CheckBox ID="cbkSelectID" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ID" HeaderText="ID" Visible="false">
                            <HeaderStyle HorizontalAlign="Center" Width="40px" />
                            <ItemStyle HorizontalAlign="Center" Width="40px" />
                        </asp:BoundField>
                        <asp:HyperLinkField DataNavigateUrlFields="ID" DataTextField="ModelName" DataNavigateUrlFormatString="Model/Model_Add.aspx?Action=Edit&ID={0}" HeaderText="模型别名">
                            <HeaderStyle Width="120px" />
                        </asp:HyperLinkField>
                        <asp:BoundField DataField="HtmlSavePath" HeaderText="存放目录">
                            <HeaderStyle HorizontalAlign="Center" Width="70px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ContentName" HeaderText="内容名称">
                            <HeaderStyle HorizontalAlign="Center" Width="70px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ContentUnit" HeaderText="内容单位">
                            <HeaderStyle HorizontalAlign="Center" Width="70px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="数据量">
                            <ItemTemplate>
                                <span datafld="<%# Eval("DataTable") %>" style=" text-align:right; width:60px; display:block;">eee</span>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Right" Width="60px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="Remark" HeaderText="备注"></asp:BoundField>
                        <asp:TemplateField HeaderText="修改">
                            <ItemTemplate>
                                <asp:HyperLink ID="HL_Eidt" runat="server" CssClass="btn btn-default" 
                                    NavigateUrl='<%# Eval("ID", "Model_Add.aspx?Action=Edit&ID={0}") %>' Text="修改"></asp:HyperLink>
                            </ItemTemplate>
                            <HeaderStyle Width="50px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="删除" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="lblDelete" CssClass="btn btn-danger" runat="server" CausesValidation="False"
                                    CommandName="Delete" Text="删除"></asp:Button>
                            </ItemTemplate>
                            <HeaderStyle Width="50px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle CssClass="HeaderStyle" />
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
